import java.util.*;
import java.io.*;

public class test {
    public static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read in = new Read();
    // 蓝桥杯 训练士兵(⭐⭐⭐)
    public static void main(String[] args) throws IOException{
        //key:训练次数 value:花费总金额
        HashMap<Integer,Long> map = new HashMap<>();
        int n = in.nextInt();
        long S = in.nextLong();
        int sum = 0;//整体最少的训练次数
        long sumPrice = 0;//单独全部训练一次的花费
        long maxPrice = 0;//训练全部顶尖展示所需最少金币数
        for(int i = 0;i < n;i++){
            long a = in.nextInt();
            int b = in.nextInt();
            map.put(b,map.getOrDefault(b,0l) + a);
            sumPrice += a;
        }
        // 1. 比较单独全部训练一次的花费(sumPrice)与整体同时训练的花费(S)的大小
        // 2. 修改maxPrice
        // 3. 修改sum,如果sum>=map中的某个值,则删除这个值
        while(!map.isEmpty()){
            maxPrice += Math.min(sumPrice,S);
            sum++;
            //查询是否有士兵训练完成
            if(map.containsKey(sum)) {
                //不再参加后续训练
                sumPrice -= map.get(sum);
                map.remove(sum);
            }
        }
        System.out.println(maxPrice);
    }
    // 蓝桥杯 分巧克力(⭐⭐⭐)
    public static int[] arr1;
    public static int[] arr2;
    public static int n;
    public static int k;
    public static void main1(String[] args) throws IOException{
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        k = in.nextInt();
        arr1 = new int[n];
        arr2 = new int[n];
        for(int i = 0;i < n;i++){
            arr1[i] = in.nextInt();
            arr2[i] = in.nextInt();
        }
        //可以选取巧克力的最大边长
        // 1. max必须大于min1(巧克力最小的长)
        // 2. max必须大于min2(巧克力最小的宽)
        int max = 0;
        int l = 1;
        int r = 10000;
        //二分查找
        //目标找到(能够切出巧克力数量>=k)为前提下,最大边长的巧克力
        while(l < r){
            int mid = (l + r + 1) / 2;
            if(getNum(mid) >= k){
                l = mid;
            }else {
                r = mid - 1;
            }
        }
        System.out.println(l);
    }
    public static int getNum(int i){
        int num = 0;
        for(int j = 0;j < n;j++){
            num += (arr1[j] / i) * (arr2[j] / i);
        }
        return num;
    }
    // 蓝桥杯 求阶乘(⭐⭐)
    static int N = 1000010;
    static int cnt[] = new int [N];
    public static void main2(String[] args) {
        Scanner in1 = new Scanner(System.in);
        int k = in1.nextInt();

        int flag = 4;

        init();

        System.out.println(cnt[k]);
    }
    static void init() {
        int jump = 5;
        int flag = 5;
        int temp = 0;
        for(int i = 1; i <= 1000000; i++) {
            if(i == jump) {
                jump += flag + 1;
                flag ++;
                cnt[i] = -1;
                temp = cnt[i-1];
            }
            else {
                cnt[i] = temp + 5;
                temp = cnt[i];
            }

        }
    }
    // 蓝桥杯 生日蜡烛(⭐)
    public static void main3(String[] args) throws IOException {
        int sum = 0;
        int i = 1;
        while(sum < 236){
            int start = i;
            for(;sum < 236;i++){
                sum += i;
            }
            if(sum == 236){
                System.out.println(start);
            }else {
                i = start + 1;
                sum = 0;
                continue;
            }
        }
    }
}
class Read{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String next() throws IOException{
        while(!st.hasMoreTokens()){
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    int nextInt() throws IOException{
        return Integer.parseInt(next());
    }
    long nextLong() throws IOException{
        return Long.parseLong(next());
    }
    double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }
}